import request from '@/utils/request';

export async function queryLawList(
  page_num,
  page_size,
  keyword = '',
  api_type = '',
  start_time = '',
  end_time = '',
  sort = ''
) {
  return request(
    `/api/gold/laws_regulations?page_num=${page_num}&page_size=${page_size}&keyword=${keyword}&api_type=${api_type}&start_time=${start_time}&end_time=${end_time}&sort=${sort}`,
    { page_num, page_size, keyword, api_type, start_time, end_time, sort }
  );
}

// 法规  检索收藏 监管函件参数
export async function getJghParam(payload) {
  return request(`/api/gold/regulatory_letter_params?stock_code=${payload.stock_code}`, {
    ...payload,
  });
}

// 法规  检索收藏 监管函件列表
export async function getJghList(payload) {
  return request(
    `/api/gold/regulatory_letter?regulatory_type_id=${
      payload.regulatory_type_id
    }&violation_type_id=${payload.violation_type_id}&keyword=${payload.keyword}&stock_code=${
      payload.stock_code
    }&company_code=${payload.company_code}&punishment_identity=${
      payload.punishment_identity
    }&averment_id=${payload.averment_id}&start_time=${payload.start_time}&end_time=${
      payload.end_time
    }&market_id=${payload.market_id}&industry=${payload.industry}&area=${
      payload.area
    }&regulatory_org_id=${payload.regulatory_org_id}&sort=${payload.sort}&page_num=${
      payload.page_num
    }&page_size=${payload.page_size}`,
    {
      ...payload,
    }
  );
}

// 法规  检索收藏 监管反馈列表
export async function getFeedBack(payload) {
  return request(
    `/api/gold/regulatory_feedback?stock_code=${payload.stock_code}&keyword=${
      payload.keyword
    }&api_type=${payload.api_type}&start_time=${payload.start_time}&end_time=${
      payload.end_time
    }&sort=${payload.sort}&page_num=${payload.page_num}&page_size=${payload.page_size}`,
    {
      ...payload,
    }
  );
}
